package com.x.provider.api.general.service;

import com.x.core.web.api.R;
import com.x.core.web.page.PageList;
import com.x.provider.api.general.constants.ServiceNameConstants;
import com.x.provider.api.general.model.dto.cms.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(contextId = "smsService", value = ServiceNameConstants.SERVICE)
public interface CmsRpcService {
    @PostMapping(ServiceNameConstants.RPC_URL_PREFIX_CMS + "/is/starred")
    R<Boolean> isStarred(@RequestBody StarStatusGetReqDTO isStarred);

    @PostMapping(ServiceNameConstants.RPC_URL_PREFIX_CMS + "/star/create")
    R<Boolean> star(@RequestBody StarSaveReqDTO starAO);

    @PostMapping(ServiceNameConstants.RPC_URL_PREFIX_CMS + "/star/list")
    R<List<StarDTO>> listStar(@RequestBody StarListReqDTO reqDTO);

    @PostMapping(ServiceNameConstants.RPC_URL_PREFIX_CMS + "/star/relation/list")
    R<Map<Long, Integer>> listStarRelation(@RequestBody StarListReqDTO reqDTO);

    @PostMapping(ServiceNameConstants.RPC_URL_PREFIX_CMS + "/comment/create")
    R<Void> comment(@RequestBody CommentAddReqDTO commentAO);

    @PostMapping(ServiceNameConstants.RPC_URL_PREFIX_CMS + "/comment/stat/list")
    R<Map<Long, CommentStatisticDTO>> listCommentStatMap(@RequestParam("idList") String idList);

    @PostMapping(ServiceNameConstants.RPC_URL_PREFIX_CMS + "/item/statistic/list")
    R<Map<Long, ItemStatisticDTO>> listStatMap(@RequestBody ItemStatListReqDTO itemStatListReqDTO);

    @PostMapping(ServiceNameConstants.RPC_URL_PREFIX_CMS + "/content/my")
    R<PageList<ContentDTO>> listMyContent(@RequestBody ContentMyReqDTO reqDTO);

    @PostMapping(ServiceNameConstants.RPC_URL_PREFIX_CMS + "/content/my/total/count")
    R<Map<Integer, Integer>> getMyContentTotal(@RequestBody ContentMyTotalReqDTO contentMyTotalReqDTO);

    @PostMapping(ServiceNameConstants.RPC_URL_PREFIX_CMS + "/content/by/ids")
    R<List<ContentDTO>> listContentByIds(@RequestBody ContentByIdsReqDTO reqDTO);

    @PostMapping(ServiceNameConstants.RPC_URL_PREFIX_CMS + "/content/create")
    R<Long> createContent(@RequestBody ContentCreateReqDTO contentCreateReqDTO);

    @PostMapping(ServiceNameConstants.RPC_URL_PREFIX_CMS + "/content/delete")
    R<Void> deleteContent(@RequestBody ContentDeleteReqDTO reqDTO);

    @PostMapping(ServiceNameConstants.RPC_URL_PREFIX_CMS + "/item/toggle/relation/list")
    R<PageList<ItemToggleRelationDTO>> listItemToggleRelation(@RequestBody ItemToggleRelationListReqDTO reqDTO);

    @PostMapping(ServiceNameConstants.RPC_URL_PREFIX_CMS + "/item/toggle/relation/save")
    R<ItemToggleRelationDTO> toggleRelation(@RequestBody ItemToggleRelationSaveReqDTO req);
}
